﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="CreateAccount.aspx.cs" Inherits="InhollandAir.CreateAccount" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    <h2>Account /</h2>
    <p>Create</p>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="BodyPlaceHolder" runat="server">

    <asp:Label ID="lbl_Error" class="alert alert-error" Visible="False" runat="server" Text=""></asp:Label>
    <form runat="server">
        <table class="table" style="width: 600px;">
            <tr>
                <td>
                    <asp:Label ID="lbl_Firstname" runat="server" Text="Label">Firstname</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Firstname" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="rqd_Firstname" runat="server" ErrorMessage="*Firstname is required" ControlToValidate="txt_Firstname" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="regEx_Firstname" runat="server" ErrorMessage="Firstname can only contain letters" ControlToValidate="txt_Firstname" ValidationExpression="^[a-zA-Z'.\s]{1,50}$" Display="Dynamic"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Lastname" runat="server" Text="Label">Lastname</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Lastname" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="rqd_Lastname" runat="server" ErrorMessage="*Lastname is required" ControlToValidate="txt_Lastname" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="regEx_Lastname" runat="server" ErrorMessage="Lastname can only contain letters" ControlToValidate="txt_Lastname" ValidationExpression="^[a-zA-Z'.\s]{1,50}$" Display="Dynamic"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Username" runat="server" Text="Label">Username</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Username" runat="server"></asp:TextBox>
                </td>
                <td>
                     <asp:RegularExpressionValidator ID="regEx_Username" runat="server" ErrorMessage="Username can only contain letters and numbers" ControlToValidate="txt_Username" ValidationExpression="^[0-9a-zA-Z''-'\s]{1,50}$" Display="Dynamic"></asp:RegularExpressionValidator>
                    <asp:CustomValidator ID="cus_Username" runat="server" ErrorMessage="There is allready an account with this username" OnServerValidate="UsernameExistence" ControlToValidate="txt_Username" Display="Dynamic"></asp:CustomValidator>
                    <asp:RequiredFieldValidator ID="rqd_Username" runat="server" ErrorMessage="*Username is required" ControlToValidate="txt_Username" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Email" runat="server" Text="Label">Email</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Email" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:CustomValidator ID="cus_Email" runat="server" ErrorMessage="There is allready an account with this Email" OnServerValidate="EmailExistence" ControlToValidate="txt_Email" Display="Dynamic"></asp:CustomValidator>
                    <asp:RequiredFieldValidator ID="rqd_Email" runat="server" ErrorMessage="*Email is required" ControlToValidate="txt_Email" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="reg_Email" runat="server" ErrorMessage="Not an valid Emailaddress" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txt_Email" Display="Dynamic"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Password" runat="server" Text="Label">Password</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Password" runat="server" TextMode="Password"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="rqd_Password" runat="server" ErrorMessage="*Password is required" ControlToValidate="txt_Password" Display="Dynamic"></asp:RequiredFieldValidator>

                    <asp:RegularExpressionValidator ID="regEx_Password" runat="server" ErrorMessage="Password must be at least 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit." ControlToValidate="txt_Password" Display="Dynamic" ValidationExpression="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,50}$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_PasswordRepeat" runat="server" Text="Label">PasswordRepeat</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_PasswordRepeat" runat="server" TextMode="Password"></asp:TextBox>
                </td>
                <td>
                    <asp:CompareValidator ID="cmp_Password" runat="server" ErrorMessage="Passwords do not match" ControlToValidate="txt_Password" ControlToCompare="txt_PasswordRepeat" Display="Dynamic"></asp:CompareValidator>
                     <asp:RegularExpressionValidator ID="regEx_PasswordRepeat" runat="server" ErrorMessage="Password must be at least 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit." ControlToValidate="txt_PasswordRepeat" Display="Dynamic" ValidationExpression="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,50}$"></asp:RegularExpressionValidator>
                
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Adress" runat="server" Text="Label">Address</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Address" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regEx_Address" runat="server" ErrorMessage="Address can only contain letters and numbers" ValidationExpression="^[0-9a-zA-Z''-'\s]{1,50}$" Display="Dynamic" ControlToValidate="txt_Address"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="rqd_Address" runat="server" ErrorMessage="*Address is required" ControlToValidate="txt_Address" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Zipcode" runat="server" Text="Label">Zipcode</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Zipcode" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regEx_Zipcode" runat="server" ErrorMessage="Zipcode can only contain letters and numbers" ControlToValidate="txt_Zipcode" ValidationExpression="^[0-9a-zA-Z''-'\s]{1,50}$" Display="Dynamic"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="req_Zipcode" runat="server" ErrorMessage="*Zipcode is required" ControlToValidate="txt_Zipcode" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>

            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_City" runat="server" Text="Label">City</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_City" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="City can only contain letters" ControlToValidate="txt_City" ValidationExpression="^[a-zA-Z'.\s]{1,50}$" Display="Dynamic"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="rqd_City" runat="server" ErrorMessage="*City is required" ControlToValidate="txt_City" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Country" runat="server" Text="Label">Country</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Country" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regEx_Country" runat="server" ErrorMessage="Country can only contain letters" ControlToValidate="txt_Country" ValidationExpression="^[a-zA-Z'.\s]{1,50}$" Display="Dynamic"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="rqd_Country" runat="server" ErrorMessage="*Country is required" ControlToValidate="txt_Country" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_Phonenr" runat="server" Text="Label">Phonenr</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_Phonenr" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="RegEx_Phonenr" runat="server" ErrorMessage="Not a valid phonenr" ControlToValidate="txt_Phonenr" ValidationExpression="^\s*\+?\s*([0-9][\s-]*){9,}$"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="rqd_Phonenr" runat="server" ErrorMessage="*Phonenr is required" ControlToValidate="txt_Phonenr" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lbl_DateOfBirth" runat="server" Text="Label">BirthDate</asp:Label><br />
                    <asp:Label ID="lbl_DateOfBirth2" runat="server" Text="Label">(mm-dd-yyyy)</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txt_DateOfBirth" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="rqd_Birthday" runat="server" ErrorMessage="*Date of birth is required" ControlToValidate="txt_DateOfBirth" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="regEx_BirthDate" runat="server" ErrorMessage="Not a valid date of birth" ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d"
                        ControlToValidate="txt_DateOfBirth" Display="Dynamic"></asp:RegularExpressionValidator>
                </td>
            </tr>

        </table>

        <asp:Button ID="btn_SubmitAccount" runat="server" class="btn btn-primary" Text="Submit" OnClick="btn_SubmitAccount_Click" />
    </form>
</asp:Content>


